import axios from 'axios';

let baseURL = process.env.NODE_ENV === 'production' ? 'http://vue.wtodd.wang:4000' : 'http://localhost:4000'
/** eslint disabled */
// 创建axios实例
const request = axios.create({
  baseURL: baseURL,
  timeout: 10000 // 请求超时时间
})

request.interceptors.request.use(
    config => {
      return config
    },
    error => {
      console.log(error) // for debug
      Promise.reject(error)
    }
)

request.interceptors.response.use(
    reponse => {
        return reponse
    }
)

export default request;